<?php
$feedbacks = $mvc->getObject(CompanyService::COMPANY_FEEDBACK);
$count = $mvc->getObject("count");
$pages = $mvc->getObject("pages");
?>
<div class="viewDComment">
<?php
if(isset($feedbacks)&&$feedbacks!=null){ ?>
	<div class="unitPagination">
		<p><span><?php echo $count;?></span> _i18n{comments}</p>
		<ul>
			<?php for($i=0; $i<$pages; $i++){ ?>
				<li>
				<?php if(isset($_GET['comment_page'])&&$_GET['comment_page']==$i+1  || !isset($_GET['comment_page'])&&$i==0) { ?>
					<span><?php echo $i+1; ?></span>
				<?php }else{ ?>
					<a href="/get-comments.html?comment_page=<?php echo $i+1; ?><?php
						echo isset($_GET['id']) ? '&id='.$_GET["id"] : NULL; 
					 ?>">
					<?php echo $i+1; ?>
					</a>
				<?php }?>
				</li>
			<?php } ?>
		</ul>
	</div>
<?php foreach($feedbacks as $key =>$feedback){?>
		<div class="unitDComment <?php echo ($key%2) == 0 ? 'unitOdd':null;?>">
			<div class="itemTitle">
				<h4><?php echo $feedback[UsersService::USERNAME] ?></h4><span class="itemDate"><?php echo $feedback[CompanyService::DATE] ?></span>
			</div>
			<div class="itemText">
				<p><?php echo $feedback[CompanyService::COMMENT] ?></p>
				<p><strong>_i18n{Order}:</strong> <a href="/view-order.html?id=<?php echo $feedback[OrdersService::HASH] ?>" title="<?php echo $feedback[OrdersService::ORDER_NAME] ?>"><?php echo $feedback[OrdersService::ORDER_NAME] ?></a></p>
			</div>
			<div class="itemRating">
				<div class="unitRating">
					<div class="simpleRating">
						<ul>
							<li class="itemCurrent" style="width:<?php echo $feedback[CompanyService::VOTE] ?>%"></li>
						</ul>
						<p><strong>1</strong> (<?php echo $feedback[CompanyService::VOTE] ?>% positiv) <a href="#" title="Extended">Extended</a></p>
					</div>
					<div class="extendRating">
						<dl>
							<dt>_i18n{Quality of work}:</dt>
							<dd><span class="itemCurrent" style="width:<?php echo $feedback[CompanyService::VOTE1] ?>%"></span></dd>
						</dl>
						<dl>
							<dt>_i18n{Reliability}:</dt>
							<dd><span class="itemCurrent" style="width:<?php echo $feedback[CompanyService::VOTE2] ?>%"></span></dd>
						</dl>
						<dl>
							<dt>_i18n{Cleanliness}:</dt>
							<dd><span class="itemCurrent" style="width:<?php echo $feedback[CompanyService::VOTE3] ?>%"></span></dd>
						</dl>
						<dl>
							<dt>_i18n{Price / Performance}:</dt>
							<dd><span class="itemCurrent" style="width:<?php echo $feedback[CompanyService::VOTE4] ?>%"></span></dd>
						</dl>
						<dl>
							<dt>_i18n{Project delivered}:</dt>
							<dd><span class="itemCurrent" style="width:<?php echo $feedback[CompanyService::VOTE5] ?>%"></span></dd>
						</dl>
						<dl>
							<dt>_i18n{Consulting Services}:</dt>
							<dd><span class="itemCurrent" style="width:<?php echo $feedback[CompanyService::VOTE6] ?>%"></span></dd>
						</dl>
						<p><a href="#" title="Avarage">Avarage</a></p>
					</div>
				</div>
			</div>
		</div>
	<?php } ?>
<?php } else { ?>
	<div class="unitDComment unitOdd">
		<div class="itemText">
			<p>_i18n{Sorry, no comments yet.}</p>
		</div>
	</div>
<?php } ?>
</div>